package com.ycrlkj.android.modulescore.main.viewmodel;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.ycrlkj.android.modulesbase.libbase.utils.PropertiesUtil;

public class RegisterViewModel extends ViewModel {

    public MutableLiveData<String> phone;
    public MutableLiveData<String> smsCode;

    public MutableLiveData<Integer> sendSmsCodeWait; //发送验证码间隔等待

    public MutableLiveData<String> servicePhone;

    public MutableLiveData<String> getPhone() {
        if(phone == null){
            phone = new MutableLiveData<>();
            phone.setValue("");
        }
        return phone;
    }

    public MutableLiveData<String> getSmsCode() {
        if(smsCode == null){
            smsCode = new MutableLiveData<>();
            smsCode.setValue("");
        }
        return smsCode;
    }

    public MutableLiveData<Integer> getSendSmsCodeWait() {
        if(sendSmsCodeWait == null){
            sendSmsCodeWait = new MutableLiveData<>();
            sendSmsCodeWait.setValue(60);
        }
        return sendSmsCodeWait;
    }

    public MutableLiveData<String> getServicePhone() {
        if(servicePhone == null){
            servicePhone = new MutableLiveData<>();
            String servicePhoneValue = PropertiesUtil.getProperty("servicePhone");
            servicePhone.setValue(servicePhoneValue);
        }
        return servicePhone;
    }

}
